<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <!-- 使用组件 -->
    <button-counter></button-counter>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    Vue.component("button-counter", { //注册组件
      data() {
        return {
          "count": 0
        }
      },
      "methods": {
        add() {
          this.count++;
        }
      },
      "template": `<button @click='add'>点击的次数{{count}}</button>`
    });
    const vm = new Vue({
      "el": "#app",
      "data": {},
      mounted() {},
      updataed() {},
      "methods": {},
      "directives": {},
      "computed": {},
      "watch": {},
      "filters": {}
    });
  </script>

</body>

</html>